Scriptable hierarchical emulation engine

ABSTRACT

In a data storage system, a hierarchical data structure, such as a file system or a database, is utilized to organize a hierarchical arrangement of device containers corresponding to various device identifiers of the plurality of hardware components in the target hardware system, scripts corresponding to various packet types of communication packets in the target hardware system, and responses corresponding to various packet data in the communication packets in the target hardware system. In response to receipt by a hierarchical emulation engine of a communication packet during emulation of the target hardware system, the communication packet including a device identifier, packet type and packet data, a response to the communication packet is determined by traversing the hierarchical arrangement based on the device identifier, packet type and packet data of the communication packet. The determined response is then provided.

BACKGROUND OF THE INVENTION

This disclosure relates in general to data processing, and morespecifically, to emulation of a target hardware system.

A well known technique for developing a target hardware system and/ormodeling its behavior is to emulate the target hardware system throughthe execution of software on a host hardware platform. Conventionalemulation techniques require the full emulation of each hardwarecomponent in the target hardware system. Because conventional emulationtechniques require execution of both the full software stack and anemulated hardware stack below it, each emulated component necessarilyconsumes more raw processing power than its physical counterpart.Consequently, emulation of a target hardware systems of significantscale (i.e., those with multiple intelligent hardware components managedby one or more management components) can be impractical on many hosthardware platforms due to processing resource constraints.

Further, in even cases in which sufficient processing resources areavailable to perform a full emulation of each hardware component of thetarget hardware system, in many cases, emulation code that mimics theinternal operation of each hardware component may not be readilyavailable or easily developed. The present disclosure appreciates,however, that even in cases in which the internal operation of ahardware component is difficult to model, interfaces to the hardwarecomponents are frequently visible and well defined.

For emulation to be helpful, the emulator should be able to quickly andconsistently produce a known state of the target hardware system. Withconventional emulation techniques, replication of a known state in theemulator may entail creating an extensive litany of internal operationsand/or user inputs performed on the target hardware system to achievethe known state. For so-called “corner” cases, a known state (e.g., aparticular failure state) may only be reached after months ofcompounding problems or human actions in the target hardware system,which may provide insufficient logging to recreate the known state inthe emulator.

The present disclosure further appreciates that it would be desirablefor a user of the emulator should be able to introduce faults, changebehaviors, or modify both software and hardware components in a way thatdoes not require disruption of the emulation. In the case of emulatedhardware components without a user interface, modification of thebehavior of the emulator components may not be possible usingconventional emulation techniques. For emulated hardware components thatsupport user-level interaction, conventional emulation techniques onlypermit the emulated hardware component to be configured through the userinterface, which artificially limits flexibility because user interfacesare typically designed to restrict the user from performing certainoperations (e.g., invalid operations) in order to minimize errors.

BRIEF SUMMARY

In at least one embodiment, a hierarchical data structure in a datastorage system, such as a file system or database, is utilized toorganize a hierarchical arrangement of device containers correspondingto various device identifiers of the plurality of hardware components inthe target hardware system, scripts corresponding to various packettypes of communication packets in the target hardware system, andresponses corresponding to various packet data in the communicationpackets in the target hardware system. In response to receipt by ahierarchical emulation engine of a communication packet during emulationof the target hardware system, the communication packet including adevice identifier, packet type and packet data, a response to thecommunication packet is determined by traversing the hierarchicalarrangement based on the device identifier, packet type and packet dataof the communication packet. The determined response is then provided.

In at least one embodiment, to emulate a hardware component of a targethardware system including a plurality of hardware components, acomponent model of the hardware component is built, where the componentmodel includes a register interface through which a host applicationprovides inputs to and reads outputs from the component model, one ormore parameter registers that hold values of state variables of thecomponent model, and a state machine that models behavior of thehardware component without explicitly emulating logic implemented in thehardware component. During modeling of the hardware component utilizingthe component model the component model is dynamically modified otherthan by modifying values of the state variables.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

FIG. 1 is a high level block diagram of an exemplary data processingsystem that may be employed to emulate a target hardware systemutilizing the techniques disclosed herein;

FIG. 2 is a high level block diagram of an exemplary data storage systemthat may be selected as a target hardware system to be emulated by theemulation engine of FIG. 1;

FIG. 3 illustrates an exemplary hierarchical emulation architecture inaccordance with one embodiment;

FIG. 4 depicts an exemplary packet format of messages exchanged betweenthe pluggable emulated device and the hierarchical emulation engine inFIG. 3;

FIG. 5 is a high level logical flowchart of an exemplary method ofemulation utilizing the hierarchical emulation architecture of FIG. 3 inaccordance with one embodiment;

FIG. 6 is a high level logical flowchart of an exemplary method ofdetermining a response to a communication packet in the method of FIG.5;

FIG. 7 illustrates a block diagram of an exemplary developmentenvironment 700 in accordance with one embodiment;

FIG. 8 illustrates another exemplary hierarchical emulation architectureincluding a component model in lieu of a fully emulated pluggable devicein accordance with one embodiment; and

FIG. 9 is a high level logical flowchart of an exemplary method ofmodeling a hardware component in accordance with one embodiment.

DETAILED DESCRIPTION

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CD-ROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain, or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described below with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

With reference now to the figures and in particular with reference toFIG. 1, there is depicted a block diagram of an exemplary dataprocessing system 100 that may be employed to emulate a target hardwaresystem utilizing the emulation techniques disclosed herein. In variousembodiments, data processing system 100 may be, for example, a mainframecomputer system, a server computer system (or processing node thereof),a desktop computer system, or a laptop, tablet or other portablecomputer system.

In the illustrated embodiment, data processing system 100 includes oneor more processors 104 that manage, access, modify, execute and/ormanipulate program code (e.g., software instructions) and/or data.Processors 102 are coupled, either directly or via one or moreintermediate components such as buses and/or bridges, to one or morenetwork interfaces 104. Network interface(s) 104, which can include, forexample, network interface cards (NICs), converged network adapters(CNAs), wireless adapters, storage system controllers, etc., provide oneor more interfaces by which data processing system 100 communicates withexternal networks and/or systems. The external systems coupled to dataprocessing system 100 via network interface(s) 104 can include, forexample, other data processing systems (e.g., peer systems, clientsystems, or server systems) or data storage systems. One exemplary datastorage system that may be utilized in combination with a dataprocessing system such as data processing system 100 of FIG. 1 isdepicted in FIG. 2.

Data processing system 100 additionally includes input/output (I/O)devices 106 coupled to processor(s) 102. These I/O devices 106 caninclude ports, displays, user input devices and attached devices, etc.,which receive inputs and provide outputs of the processing performed bydata processing system 100 and/or other external resource(s) coupled todata processing system 100. Finally, data processing system 100 includesa local data storage system 108, which may include one or more volatileor non-volatile storage devices, including memories, solid state drives,optical or magnetic disk drives, tape drives, etc.

In the illustrated embodiment, data storage system 108 stores programcode (including software, firmware or a combination thereof) and datathat can be processed by processor(s) 102. The program code thatpopulates data storage system 108 includes an operating system (OS) 110,such as Windows®, UNIX®, AIX or Linux, that manages the resources ofdata processing system 100. In at least some embodiments, OS 110includes a shell 140 (as it is called in UNIX®) for providing a commandinterpreter and a user interface to the resources of data processingsystem 100. OS 110 also includes kernel 114, which provides services toapplication programs as well as lower level management functions, suchas memory management, process and task management, device and filesystem management, and mouse and keyboard management.

Data storage system 108 additionally stores one or more applicationprograms 120 that run on top of operating system 110. In the illustratedembodiment, these application programs 120 include an emulator 122 thatprovides full emulation of the internal states, processing andcommunication of a selected hardware component (e.g., a managementcomponent) of a target hardware system. The selected hardware componentis represented in data storage system 108 by pluggable emulated device126. In some embodiments, emulator 122 may be a conventional emulator,such as QEMU (Quick EMUlator).

Application programs 120 further include a hierarchical emulation engine124 that emulates communication between the hardware component emulatedby emulator 121 (i.e., pluggable emulated device 126) and other hardwarecomponents of the target hardware system. Data (including state data)and program code representing the target hardware system can be storedwithin data storage system 108 as a system model 124. In one preferredembodiment discussed in greater detail below, system model 124 has ahierarchical architecture that leverages the existing hierarchicalstructure of the file system implemented by kernel 114 in order toorganize its constituent components. In a preferred embodiment,hierarchical emulation engine 124 may thus be implemented as a scriptthat can interpret a generic file system storage hierarchy.

The hardware and software components of data processing system 100depicted in FIG. 1 are not intended to be exhaustive, but ratherrepresent and/or highlight certain components that may be utilized topractice the disclosed embodiments. Accordingly, those skilled in theart will appreciate that additional or alternative components may beemployed in data processing system 100 within the spirit and scope ofthe appended claims.

Referring now to FIG. 2, there is depicted a high level block diagram ofan exemplary data storage system 200 that may be selected as a targethardware system to be emulated by hierarchical emulation engine 124 ofFIG. 1. As shown, data storage system 200 includes an interface 202through which data storage system 200 communicates with other systems,such as data processing system 100, via an I/O channel 204. In variousembodiments, I/O channel 204 may employ any one or a combination ofknown or future developed communication protocols, including, forexample, Fibre Channel (FC), FC over Ethernet (FCoE), Internet SmallComputer System Interface (iSCSI), Transport Control Protocol/InternetProtocol (TCP/IP), etc. I/O operations (IOPs) communicated via I/Ochannel 110 include read IOPs requesting data from data storage system200 and write IOPs requesting storage of data in data storage system200.

Interface 202 is coupled to a flash controller 204 (e.g., an ApplicationSpecific Integrated Circuit (ASIC) or Field Programmable Gate Array(FPGA)) having an associated flash controller memory 206 (e.g., DynamicRandom Access Memory (DRAM)). Flash controller 124 is additionallycoupled to a CPU 208 having an associated CPU memory 210 (e.g., DRAM)and further coupled to a NAND flash memory array 140. NAND flash memoryarray 140 includes multiple flash memory modules 220 a-220 n, which inat least some embodiments comprise intelligent subsystems capable ofself-managing and making autonomous decisions based on their internalstates.

In embodiments in which flash controller 204 is implemented with anFPGA, CPU 208 may program and configure flash controller 204 duringstart-up of data storage system 200. After startup, in general operationflash controller 204 receives read and write IOPs via I/O channel 204and interface 202 to read data stored in NAND flash memory array 212and/or to store data in NAND flash memory array 212. Flash controller204 services these IOPs, for example, by accessing NAND flash memoryarray 212 to read or write the requested data from or into NAND flashmemory array 212 or by accessing a memory cache (not illustrated)associated with NAND flash memory array 212.

Flash controller 124 implements a flash translation layer that provideslogical-to-physical address translation to enable access to specificmemory locations within NAND flash memory array 212. In general, an IOPreceived by flash controller 212 from a host device, such as dataprocessing system 100, contains the logical block address (LBA) at whichthe data is to be accessed (read or written) and, if a write IOP, thewrite data to be stored to data storage system 200. The IOP may alsospecify the amount (or size) of the data to be accessed. The flashtranslation layer translates this LBA into a physical address assignedto a corresponding physical location in NAND flash memory array 212.Flash controller 124 may perform address translation and/or storemappings between logical and physical addresses in a logical-to-physicaltranslation data structure, such as translation table 222, which mayconveniently be stored in flash controller memory 206.

With reference to FIG. 3, there is illustrated an exemplary hierarchicalemulation architecture 300 in accordance with one embodiment. Incontrast to conventional emulation environments in which each hardwarecomponent of the target hardware system and its associated states,communication and functionality are all full emulated, the exemplaryhierarchical emulation architecture 300 of FIG. 3 focuses on emulatingthe communication between a fully emulated pluggable emulated device 126and other hardware components of target hardware system.

In the exemplary hierarchical emulation architecture 300, a perspectivefor the emulation is selected, as represented by selection of one of thecomponents of the target hardware system as a component to be fullyemulated as pluggable emulated device 126. In general, it is preferred(but not required) for the hardware component that is selected foremulation by pluggable emulated device 126 to be a management componentthat jointly or solely manages some or all of the other hardwarecomponents of the target hardware system. For example, if data storagesystem 200 of FIG. 2 (or an enhanced version thereof that is underdevelopment) is selected as the target hardware platform, flashcontroller 204 can be selected as the hardware component emulated bypluggable emulated device 126.

As noted above, in at least some embodiments, pluggable emulated device126 is emulated utilizing conventional emulation techniques. Forexample, in one embodiment pluggable emulated device 126 can be emulatedutilizing QEMU, which can be executed by a process of OS 110.

Pluggable emulated device 126 communicates with hierarchical emulationengine 124 via an emulated bus 302. Emulated bus 302 corresponds to aphysical interface of the target hardware system through which thehardware component modeled by pluggable emulated device 306 exchangesmessages with other hardware components of the target hardware system(e.g., the managed components). Emulated bus 302 may be implemented forexample, using inter-process communication (IPC) between the processrunning emulator 122 and the process running hierarchical emulationengine 124.

In at least some embodiments, the messages transmitted by pluggableemulated device 126 may take the generalized packet format depicted inFIG. 4. As shown, an exemplary communication packet 400 sent by emulatedcomponent 302 may include a device identifier field 402 that specifiesone or more hardware components of the target hardware system that arethe intended recipient(s) of communication packet 400. In addition,communication packet 400 may includes a packet type field 404 indicatinga packet type of communication packet 400 and a packet data field 406containing packet data, if any. Responses provided by hierarchicalemulation engine 124 to emulated component 302 via emulated bus 304 onbehalf of the emulated hardware components of the target hardware systemmay employ the same, a similar or a different format than communicationpacket 400.

The hardware components of hierarchical emulation architecture 300 withwhich emulated component 302 can communicate are each represented inhierarchical emulation architecture 130 by a respective one of devicecontainers 306. As shown, device containers 306, which are eachimplemented with a file system construct such as a directory, folder orother file system construct, are preferably each associated by the filesystem with a corresponding hardware component of the target hardwaresystem by the component's device ID. Device containers 306 preferably(but not necessarily) all reside at a common level of hierarchy of thefile system implemented by operating system 110, arbitrarily designatedin FIG. 3 as file system hierarchy level 1.

As shown, each device container 306 contains or is otherwise associatedby the file system (e.g., by a directory, folder, or other file systemconstruct) with a set of scripts 308 executable by processors 102. Eachof the scripts preferably corresponds to and is associated by the filesystem with a respective packet type that can be received from emulatedcomponent 302 by the hardware component corresponding to the enclosingdevice container 306. For example, a packet of type 1 that can bereceived by device 2 is associated by the file system with packet type 1script 308, a packet of type 2 that can be received by device 2 isassociated by the file system with packet type 2 script 308, etc. Itshould be appreciated that at least some of the containers 306 willcontain different scripts and different numbers of scripts. Again, thesets of scripts of all of the hardware devices are preferably (but notnecessarily) stored at a common hierarchy level of the operatingsystem's file system, such as file system hierarchy level 2.

FIG. 3 further illustrates that each script 308 is associated by thefile system (e.g., by directory, folder, or other file system construct)with a set of responses to the type of communication packetcorresponding to the associated script. For example, FIG. 3 illustratesthat packet type 2 script 308 has an associated set of responsesincluding responses 310 a-310 p. Each response is preferably associatedby the file system with corresponding packet data. The sets of responsesassociated with all the scripts are preferably (but not necessarily)stored at a common hierarchy level of the operating system's filesystem, such as file system hierarchy level 3. It should be appreciatedthat file system hierarchy levels 1, 2 and 3 can be, but need not be,consecutive levels of hierarchy.

Although FIG. 3 illustrates an exemplary hierarchical emulationarchitecture 300 in which the hierarchy of devices, packet types andresponses is organized by employing the hierarchical structure inherentin an operating system's file system, the disclosed hierarchicalemulation engine 124 can alternatively organize these elements via otherhierarchical data structures. For example, in one alternativeembodiment, a standard database (such as SQL) can be populated withstatic variables. Hierarchical emulation engine 124 can, instead oftraversing a file system directory, perform an SQL SELECT query againstthe database to retrieve the correct response.

With reference now to FIG. 5, there is illustrated a high level logicalflowchart of an exemplary method of emulation utilizing the hierarchicalemulation architecture 300 of FIG. 3 in accordance with one embodiment.As with the other logical flowchart(s) illustrated herein, FIG. 5depicts operations in a logical rather than strictly chronologicalorder, and in some embodiments, operations may be performed in adifferent order than illustrated or concurrently. In at least someembodiments, the illustrated process can be performed by data processingsystem 100 through the execution of emulator 122 and hierarchicalemulation engine 124 in two processes.

The method depicted in FIG. 5 begins at block 500 and thereafterproceeds to block 502, which illustrates creating a set of communicationpackets that can be transmitted by the hardware component of the targethardware system modeled by pluggable emulated device 126 and acorresponding set of responses for each communication packet. Forexample, for a target hardware system under development, the set ofcommunication packets and the sets of responses can be defined bydevelopers and stored in a file. Alternatively or additionally, the setof communication packets and the sets of responses can be gathered froma physical implementation of the target hardware system by taking“snapshots” of the system. That is, diagnostic tools can be utilized toboth send communication packet to the target hardware system (andindividual hardware components thereof) and report responses. A scriptcan additionally interpret user input (through a file or other method)to determine every possible communication packet that can be transmittedin the target hardware system and to record (e.g., in a file) eachcommunication packet and its associated response(s).

At block 504, hierarchical emulation engine 124 is initialized. Forexample, in one embodiment, during the initialization processhierarchical emulation engine 124 reads and interprets the filecontaining the communication packets and responses created at block 502and builds the hierarchical emulation architecture 300 shown in FIG. 3.Hierarchical emulation engine 124 interprets and correlates each messagewith a particular hardware device based on the device identifiersspecified in the device identifier fields 402 of the communicationpackets. Hierarchical emulation engine 124 then extracts the packet datafrom the packet data fields 406 of the communication packets and storesthe data under the file system hierarchy. The data can be stored, forexample, in a file or other container that will be persistent acrossmultiple independent processes that are likely not known at the time ofinitialization. If necessary, hierarchical emulation engine 124 thenmodifies each of these data files to update the hardware mapping toaccount for variables or data that are different between system model128 and the target hardware system. This modification allows differentbut similar systems to be interchangeable.

Thus, for example, this modification permits emulation of differentgenerations of technology, such as an older 24 nm flash SSD or a newer19 nm SSD. As another example, such modifications can also permitemulation of FibreChannel and InfiniBand adapters interchangeably. Thesecomponents, which are quite similar in their operation, are equivalentlysubstitutable in the hierarchical emulation. Once a model for one deviceis created, substantive portions of that model can be re-used to emulateone or more other similar devices. Consequently, unlike traditionalemulation that generally requires even like devices to have fullyworking independent emulators; the described technique allows asubstantive model to be used for multiple different devices.

At block 506, emulation by emulator 122 of a selected hardware componentof the target hardware system utilizing pluggable emulated device 126 isinitiated on data processing system 100. As noted above, emulator 122preferably fully models the internal states, internal processing andcommunication of the selected hardware component of the target hardwaresystem. During the emulation, hierarchical emulation engine 124 monitorsfor any communication packets transmitted by pluggable emulated device126 on emulated bus 302 (block 510). Other than the minimal monitoringshown at block 510 (and that discussed below at block 516), hierarchicalemulation engine 124 is preferably inactive during emulation unless anduntil a communication packet is detected, thus conserving processingresources of data processing system 100 and increasing the scale oftarget hardware system that can be effectively emulated.

In response to detection of a communication packet transmitted bypluggable emulated device 126, hierarchical emulation engine 124 causesan appropriate response to the communication packet to be determined andprovided to pluggable emulated device 126 via emulated bus 302, as shownat blocks 512-514. In a preferred embodiment, hierarchical emulationengine 124 performs the operations at blocks 512-514 through invocationof a script in a new process. Further details regarding thedetermination of the response at block 512 are provided below withreference to FIG. 6.

In addition to providing a response to the communication packet,hierarchical emulation engine 124 may also optionally inject a desiredstate into system model 128, for example, based on one or more receivedcommunication packets, or alternatively, independently of any receivedcommunication packets (block 516). In one use case, the state may be anerror state of the target hardware system. In another use case, thestate may be a non-error state of the target hardware system.Hierarchical emulation engine 124 may inject the desired state, forexample, based on a predetermined rule specified by the scriptimplementing hierarchical emulation engine 124 or in response to userinput prompted by hierarchical emulation engine 124. Thus, in one usecase, injection may be utilized to cycle the modeled hardware systemthrough its error and/or non-error states in a predetermined order, in arandom order, in a sequence determined based on one or more receivedcommunication packets, etc.

Following optional block 516, hierarchical emulation engine 124determines at block 518 whether or not an input has been received (e.g.,from emulator 122) that terminates emulation. If not, the processreturns to block 510, which depicts hierarchical emulation engine 124continuing to monitor for receipt of additional communication packets.In response to a determination at block 516 that an input terminatingemulation has been received, the process of FIG. 5 ends at block 520.

Although not explicitly illustrated in FIG. 5, it will be understood bythose skilled in the art that hierarchical emulation engine 124 mayconcurrently service multiple communication packets through theexecution of multiple concurrent processes.

Referring now to FIG. 6, there is depicted a high level logicalflowchart of an exemplary method of determining a response to acommunication packet in the method of FIG. 5. As noted above, theprocess of FIG. 6 is performed at block 512 of FIG. 5.

The process of FIG. 6 begins at block 600 in response to receipt byhierarchical emulation engine 124 of a communication packet frompluggable emulated device 126 via emulated bus 302. The process thenproceeds from block 600 to block 602, which illustrates hierarchicalemulation engine 124 decoding and interpreting the various fields of thecommunication packet, including device identifier field 402, packet typefield 404 and packet data field 406. Utilizing the device identifierspecified in device identifier field 402 of the communication packet asa key, hierarchical emulation engine 124 traverses from the root systemdirectory in which it resides to file system level 1 to file systemlevel 2. In so doing, hierarchical emulation engine 124 selects a set ofscripts associated with the hardware component based on the deviceidentifier (block 604).

As shown at block 606, hierarchical emulation engine 124 selects one ofthe scripts from the set of scripts selected at block 604 based on thepacket type indicated by packet type field 404 of the communicationpacket. Hierarchical emulation engine 124 then launches execution of theselected script, preferably in a new process, and passes the script oneor more packet data parameters determined at block 602. The script thenparses the packet data parameter(s) and determines whether or not thepacket data parameter(s) satisfy (e.g., match, fall within, exceed orare less than) predefined parameters that require special handling(block 610). If not, the processing of the script continues at block614, which is described below. If, however, the script determines atblock 610 that the packet data parameter(s) satisfy the predeterminedparameters, the script interprets that packet data parameter(s) andperforms the action defined in the script to update the system state ofsystem model 128. In this manner, the effects of a series ofcommunication packets that are interdependent can be properly emulated.The process then proceeds from block 612 to block 614.

At block 614, the script traverses from file system hierarchy level 2 tofile system hierarchy level 3 to locate a set of possible responses 310that it can provide to the communication packet. Based on the packetdata parameters received from hierarchical emulation engine 124, thescript selects a response from the set of possible responses.Thereafter, the process of FIG. 6 ends at block 620. The script thenupwardly traverses the file system hierarchy to return the response tohierarchical emulation engine 124, which provides the selected responseto the pluggable emulated device 126 as depicted at block 514 of FIG. 5and as discussed above.

It should be appreciated that one benefit of the hierarchical emulationarchitecture 300 disclosed herein and the associated processesillustrated in FIGS. 5-6 is that a user can readily modify the behaviorof system model 128 during emulation by modifying any desiredgranularity of data within system model 128. For example, the user canmodify all device containers, one device container, one or more scriptsin a device container, and/or the data associated with the variousresponses. According to one emulation protocol, a library of knownsystem states can be obtained, for example, from developer definitionsor through system snapshots. The user can easily and directly configuresystem model 128 in any of (or a sequence of) these various systemstates by modifying components of hierarchical emulation architecture300 while hierarchical emulation engine 124 and pluggable emulateddevice 126 are running (and without restart). The freely customizablenature of system model 128 is particularly enabled by the use ofscripts, which execute independent from and outside the context ofhierarchical emulation engine 124, meaning that the scripts, responses,and associated packet data can be modified or swapped without restart ofhierarchical emulation engine 124 or emulator 122.

Heretofore, embodiments have been described in which one hardwarecomponent of the target hardware system is selected as a point ofperspective and is represented in hierarchical emulation environment 300by a pluggable emulated device 126 that is executed by a possiblyconventional emulator 122, such as QEMU. In such embodiments, pluggableemulated device 126 is fully emulated, meaning that emulator 122represents the specific logic circuitry, signals, registers, functionsand communications of the internal functional units of the selectedhardware component in the execution of pluggable emulated device 126.

However, in at least some cases, the development time and cost requiredto achieve a fully emulated hardware design may be unwarranted and/orunavailable. This limitation in development time and/or cost isparticularly likely to arise in the development of target hardwaresystems including intelligent subsystems and/or hardware components thatform multiple independent decision points because, in such cases, thepresence of multiple independent decision points in the system createsan exponentially greater number of possible component interactions.Because of the challenge in creating the fully emulated hardware design,other development efforts, such as development of firmware or software,can be undesirably serialized and delayed until after the development ofthe fully emulated hardware design.

In order to allow parallelization of development efforts (e.g., ofhardware and software/firmware designs), in at least some embodiments itis desirable to perform lightweight modeling of hardware components of atarget hardware system rather than full emulation, while extending thescope of such modeling beyond that implemented by hierarchical emulationengine 124. With reference now to FIG. 7, there is illustrated a blockdiagram of an exemplary development environment 700 in accordance withone embodiment.

Development environment 700 includes a host application 702, which canbe, for example, software and/or firmware under development. Hostapplication 702 can run, for example, as a process on data processingsystem 100. In some implementations, host application 702 controls amanagement component, for example, flash controller 204 or CPU 208 ofdata storage system 200, that manages one or other hardware componentsof the target hardware system.

Development environment 700 further includes a component model 704 thatmodels a selected hardware component of a target hardware system. Insome implementations, component model 704 models a management componentthat manages one or other hardware components, for example, flashcontroller 204 or CPU 208 of data storage system 200, and may, in fact,represent the underlying hardware on which host application 702 isintended to execute. In other implementations, component model 704models a managed component, such as a flash memory modules 220, and hostapplication 702 can provide the functionality of the managed component.Component model 704 can preferably be brought up independently from hostapplication 702 in order to accurately represent behavior in the targethardware system in which hardware components are brought up at differenttimes, fail and/or are replaced. In contrast to a fully emulated virtualrepresentation such as a pluggable emulated device 126, component model704 represents the selected hardware component in a lightweight mannerutilizing three components, namely, a register interface 706, parameterregisters 708, and state machine 710. In this lightweightrepresentation, component model 704 need not, and preferably does not,execute within a simulator environment. Further, component model 704preferably models the state and behavior of the corresponding hardwarecomponent without explicitly emulating the logic implemented in thecorresponding hardware component.

Register interface 706 is an interface that can be written and read byhost application 702. For example, host application 702 can utilizeregister interface 706 to read and write specific registers to read andwrite state data to and from component model 704 and to requestperformance of various actions by component model 704. In a preferredembodiment, the number of registers modeled by register interface 706 isfreely modifiable, such that virtual registers can be dynamically addedor removed as needed or desired during emulation.

Parameter registers 708 are a collection of state informationrepresenting the current state of component model 704. The stateinformation within parameter registers 708 can be persistent ornon-persistent. As indicated in FIG. 7, parameter registers 708 arecommunicatively coupled to register interface 706 to permit the state ofcomponent model 704 to be read or set via register interface 706 in thesame manner as the state of the corresponding hardware component.

State machine 710 represents the core functionality of the hardwarecomponent modeled by component model 704 based on the state indicatedparameter registers 708. As indicated in FIG. 7, state machine 710 iscommunicatively coupled to register interface 706 to enable one or morefunctions of state machine 710 to be invoked (including an update toparameter register 708) via register interface 706 in the same manner asthe corresponding hardware component.

Development environment 700 additionally includes a control andinjection engine (CIE) 712, which can be implemented, for example, as ascript that executes on data processing system 100 in a differentprocess from host application 702 and component model 704. CIE 712 iscommunicatively coupled to parameter registers 708 and state machine 710in order to modify the behavior of component model 704 to injectspecific states, for example, by dynamically setting values of static ordynamic variables in parameter registers 708 during execution ofcomponent model 704. Thus, in one use case, CIE 712 can inject errors incomponent model 704 to enable testing of error handling by hostapplication 702 without requiring the error states to be produced byphysical or emulated hardware.

Referring now to FIG. 8, there is depicted another exemplaryhierarchical emulation architecture 800 in which like reference numeralsare utilized to denote like and corresponding features to thehierarchical emulation architecture 300 given in FIG. 3. Hierarchicalemulation architecture 800 illustrates that a component model 704 can beemployed in lieu of a fully emulated pluggable device 126 to enable alighter weight modeling of the target hardware system. In suchimplementations, component model 704 is communicatively coupled with ahost application 702 and a CIE 712 as described above with reference toFIG. 7. The remainder of hierarchical emulation architecture 800 canadvantageously remain as described above with reference to FIGS. 3-6.

With reference now to FIG. 9, there is illustrated a high level logicalflowchart of an exemplary method of modeling a hardware component of atarget hardware system in accordance with one embodiment. In at leastsome embodiments, the illustrated process can be performed by dataprocessing system 100 through the execution of hierarchical emulationengine 124, host application 702, component model 704 and CIE 712 infour different processes to permit their independent execution.

The process of FIG. 9 begins at block 900 and then proceeds to block902, which illustrates the step of building a component model 704corresponding to a selected hardware component of the target hardwaresystem. The component model 704 will include a register interface 706,parameter registers 708 and a state machine 710 as shown in FIG. 7. Asnoted above, in the exemplary data storage system 200 of FIG. 2, theselected hardware component may be, for example, a module 220 of NANDflash memory array 212.

In a preferred embodiment, component model 704 can be built updynamically during execution, for example, in development environment700 or hierarchical emulation architecture 800. That is, component model704 can initially model the hardware component very simply with one ormore static variables and, optionally, one or more dynamic variableswithin parameter registers 708. The static variables can include, forexample, a static variable such as PowerState=ON, that permits hostapplication 702 to register the presence of a modeled hardwarecomponent. As indicated at block 904, during model execution, the staticvariable(s) can be augmented with, or converted into, dynamic variablesand, if desired, one or more dynamic variable can also be converted tostatic variables. It should be noted that the modification of componentmodel 704 illustrated at block 904 is not a modification of the value ofa state variable of component model 704 (e.g., an update to the valuesstored in parameter registers 708, such as changing PowerState from ONto OFF), but is instead a modification of the model itself. The dynamicmodification depicted at block 904 can include dynamic modification toregister interface 706, for example, to add or delete registers that canread and/or written, to modify whether a register is read-only,write-only or both read and write, to change legal variable types ofsuch registers (e.g., numeric, string, Boolean, etc.), etc. The dynamicmodification shown at block 904 can alternatively or additionallyinclude modification of parameter registers 708, for example, to add ordelete parameter registers 708, to change state variables held inparameter registers 708 between static and dynamic (as noted above), tochange legal variable types of parameter registers 708 (e.g., numeric,string, Boolean, etc.), etc. The dynamic modification depicted at block904 can alternatively or additionally include modification of statemachine 710, for example, to add and/or delete error and/or non-errorstates of component model 704, to modify transitions between suchstates, to modify state variable values that trigger state changes, etc.

As indicated at block 906, during model execution, CIE 712 may changethe values of parameter registers 708 or modify state machine 710. CIE712 may modify component model 704 in either of these ways in anautomated fashion, for example, by reference to a rule set implementedby the script utilized to implement CIE 712, or in an interactivefashion that solicits user-level input(s). As noted above, a particularuseful application of the dynamic modifications made by CIE 712 is tomodel various error states to be handled by host application 702. At thetermination of model execution, the process of FIG. 9 ends at block 908.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

As has been described, in one embodiment a hierarchy in a data storagesystem, such as a file system or database hierarchy, is utilized toorganize a hierarchical arrangement of device containers correspondingto various device identifiers of the plurality of hardware components inthe target hardware system, scripts corresponding to various packettypes of communication packets in the target hardware system, andresponses corresponding to various packet data in the communicationpackets in the target hardware system. In response to receipt by ahierarchical emulation engine of a communication packet during emulationof the target hardware system, the communication packet including adevice identifier, packet type and packet data, a response to thecommunication packet is determined by traversing the hierarchicalarrangement based on the device identifier, packet type and packet dataof the communication packet. The determined response is then provided.

In at least one embodiment, to emulate a hardware component of a targethardware system including a plurality of hardware components, acomponent model of the hardware component is built, where the componentmodel includes a register interface through which a host applicationprovides inputs to and reads outputs from the component model, one ormore parameter registers that hold values of state variables of thecomponent model, and a state machine that models behavior of thehardware component without explicitly emulating logic implemented in thehardware component. During modeling of the hardware component utilizingthe component model the component model is dynamically modified otherthan by modifying values of the state variables.

While the present invention has been particularly shown as describedwith reference to one or more preferred embodiments, it will beunderstood by those skilled in the art that various changes in form anddetail may be made therein without departing from the spirit and scopeof the invention. For example, although aspects have been described withrespect to a data storage system including a flash controller thatdirects certain functions, it should be understood that presentinvention may alternatively be implemented as a program productincluding a storage device storing program code that can be processed bya processor to perform such functions or cause such functions to beperformed. As employed herein, a “storage device” is specificallydefined to include only statutory articles of manufacture and to excludetransitory propagating signals per se.

What is claimed is:
 1. A method of emulating a target hardware systemincluding a plurality of hardware components, the method comprising: ina data storage system, utilizing a hierarchical data structure toorganize a hierarchical arrangement of device containers correspondingto various device identifiers of the plurality of hardware components inthe target hardware system, scripts corresponding to various packettypes of communication packets in the target hardware system, andresponses corresponding to various packet data in the communicationpackets in the target hardware system; in response to receipt by ahierarchical emulation engine of a communication packet during emulationof the target hardware system, the communication packet including adevice identifier, packet type and packet data, determining a responseto the communication packet by traversing the hierarchical arrangementbased on the device identifier, packet type and packet data of thecommunication packet; and providing the determined response.
 2. Themethod of claim 1, wherein determining the response includes: thehierarchical emulation engine selecting a script based on the packettype of the communication packet; and the script executing to determinethe response based on the packet data of the communication packet. 3.The method of claim 2, and further comprising the selected scriptupdating a system state of a system model of the target hardware systemin response to the packet data satisfying one or more predefinedparameters.
 4. The method of claim 1, and further comprising thehierarchical emulation engine receiving the communication packet via anemulated bus via inter-process communication.
 5. The method of claim 4,wherein: the method further includes fully emulating a selected hardwarecomponent of the target hardware system with a pluggable emulateddevice; and the receiving includes the hierarchical emulation enginereceiving the communication packet from the pluggable emulated device.6. The method of claim 1, and further comprising: capturing a set ofcommunication packets and corresponding sets of responses from aphysical realization of the target hardware system; and building thehierarchical arrangement from the set of communication packets andcorresponding sets of responses captured from the physical realizationof the target hardware system.
 7. The method of claim 1, and furthercomprising the hierarchical emulation engine injecting a desired stateinto a system model of the target hardware system.
 8. A data processingsystem, comprising: a processor; a data storage system coupled to theprocessor; and program code within the data storage system that, whenexecuted by the processor, causes the data processing system to perform:utilizing a hierarchical data structure of the data storage system toorganize a hierarchical arrangement of device containers correspondingto various device identifiers of the plurality of hardware components inthe target hardware system, scripts corresponding to various packettypes of communication packets in the target hardware system, andresponses corresponding to various packet data in the communicationpackets in the target hardware system; in response to receipt of acommunication packet during emulation of the target hardware system, thecommunication packet including a device identifier, packet type andpacket data, determining a response to the communication packet bytraversing the hierarchical arrangement based on the device identifier,packet type and packet data of the communication packet; and providingthe determined response.
 9. The data processing system of claim 8,wherein: the program code includes a hierarchical emulation engine; andthe determining the response includes: the hierarchical emulation engineselecting a script based on the packet type of the communication packet;and the script executing to determine the response based on the packetdata of the communication packet.
 10. The data processing system ofclaim 9, wherein the selected script updates a system state of a systemmodel of the target hardware system in response to the packet datasatisfying one or more predefined parameters.
 11. The data processingsystem of claim 8, wherein the program code includes a hierarchicalemulation engine that receives the communication packet via an emulatedbus via inter-process communication.
 12. The data processing system ofclaim 11, wherein: the program code includes an emulator that fullyemulates a selected hardware component of the target hardware systemwith a pluggable emulated device; and the receiving includes thehierarchical emulation engine receiving the communication packet fromthe pluggable emulated device.
 13. The data processing system of claim8, wherein the program code further causes the data processing system toperform: capturing a set of communication packets and corresponding setsof responses from a physical realization of the target hardware system;and building the hierarchical arrangement from the set of communicationpackets and corresponding sets of responses captured from the physicalrealization of the target hardware system.
 14. The data processingsystem of claim 8, wherein the hierarchical emulation engine injects adesired state into a system model of the target hardware system.
 15. Aprogram product, comprising: a storage device; program code storedwithin the storage device that, when executed by a processor of a dataprocessing system, causes the data processing system to perform:utilizing a hierarchical data structure in a data storage system toorganize a hierarchical arrangement of device containers correspondingto various device identifiers of the plurality of hardware components inthe target hardware system, scripts corresponding to various packettypes of communication packets in the target hardware system, andresponses corresponding to various packet data in the communicationpackets in the target hardware system; in response to receipt of acommunication packet during emulation of the target hardware system, thecommunication packet including a device identifier, packet type andpacket data, determining a response to the communication packet bytraversing the hierarchical arrangement based on the device identifier,packet type and packet data of the communication packet; and providingthe determined response.
 16. The program product of claim 15, wherein:the program code includes a hierarchical emulation engine; and thedetermining the response includes: the hierarchical emulation engineselecting a script based on the packet type of the communication packet;and the script executing to determine the response based on the packetdata of the communication packet.
 17. The program product of claim 16,wherein the selected script updates a system state of a system model ofthe target hardware system in response to the packet data satisfying oneor more predefined parameters.
 18. The program product of claim 15,wherein the program code includes a hierarchical emulation engine thatreceives the communication packet via an emulated bus via inter-processcommunication.
 19. The program product of claim 18, wherein: the programcode includes an emulator that fully emulates a selected hardwarecomponent of the target hardware system with a pluggable emulateddevice; and the receiving includes the hierarchical emulation enginereceiving the communication packet from the pluggable emulated device.20. The program product of claim 15, wherein the program code furthercauses the data processing system to perform: capturing a set ofcommunication packets and corresponding sets of responses from aphysical realization of the target hardware system; and building thehierarchical arrangement from the set of communication packets andcorresponding sets of responses captured from the physical realizationof the target hardware system.